<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of categories_m
 *
 * @author QUYET
 */
class Categories_m extends CI_Model{
    //put your code here
    function __construct() {
        parent::__construct();
    }
    function get_product_categories(){
        $data = $this->db->select('es_category.id_category,es_category_lang.`name`,es_category.id_parent,es_category.level_depth,es_category.nleft,es_category.nright')
                ->from('es_category,es_category_lang')
                ->Where('es_category.id_category = es_category_lang.id_category')
                ->where('es_category_lang.id_lang',1)
                ->get()
                ->result_array();
        return json_encode($data);
    }
}

?>
